package com.aptemo.webetek.client.events;

import com.google.gwt.event.shared.GwtEvent;
import com.google.gwt.user.client.ui.HasText;

public class DecisionEvent
		extends GwtEvent<DecisionHandler>
{
	public static GwtEvent.Type<DecisionHandler>	TYPE	= new GwtEvent.Type<DecisionHandler>();

	private HasText									infoField;
	private String									id;

	protected DecisionEvent()
	{

	}

	public DecisionEvent(HasText infoField)
	{
		this(infoField, "");
	}

	public DecisionEvent(HasText infoField, String id)
	{
		this.infoField = infoField;
		this.id = id;
	}

	@Override
	protected void dispatch(DecisionHandler handler)
	{
		handler.onConfirmation(this);
	}

	@Override
	public com.google.gwt.event.shared.GwtEvent.Type<DecisionHandler> getAssociatedType()
	{
		return TYPE;
	}

	public HasText getInfoField()
	{
		return infoField;
	}

	public String getId()
	{
		return id;
	}

}
